3.1.66 \(\int \csc (c+d x) (a+b \sin ^2(c+d x)) \, dx\) [66]

Optimal. Leaf size=26 \[ -\frac {a \tanh ^{-1}(\cos (c+d x))}{d}-\frac {b \cos (c+d x)}{d} \]

[Out]

-a*arctanh(cos(d*x+c))/d-b*cos(d*x+c)/d

________________________________________________________________________________________

Rubi [A]
time = 0.02, antiderivative size = 26, normalized size of antiderivative = 1.00, number of steps used = 2, number of rules used = 2, integrand size = 19, \(\frac {\text {number of rules}}{\text {integrand size}}\) = 0.105, Rules used = {3093, 3855} \begin {gather*} -\frac {a \tanh ^{-1}(\cos (c+d x))}{d}-\frac {b \cos (c+d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Int[Csc[c + d*x]*(a + b*Sin[c + d*x]^2),x]

[Out]

-((a*ArcTanh[Cos[c + d*x]])/d) - (b*Cos[c + d*x])/d

Rule 3093

Int[((b_.)*sin[(e_.) + (f_.)*(x_)])^(m_.)*((A_) + (C_.)*sin[(e_.) + (f_.)*(x_)]^2), x_Symbol] :> Simp[(-C)*Cos
[e + f*x]*((b*Sin[e + f*x])^(m + 1)/(b*f*(m + 2))), x] + Dist[(A*(m + 2) + C*(m + 1))/(m + 2), Int[(b*Sin[e +
f*x])^m, x], x] /; FreeQ[{b, e, f, A, C, m}, x] &&  !LtQ[m, -1]

Rule 3855

Int[csc[(c_.) + (d_.)*(x_)], x_Symbol] :> Simp[-ArcTanh[Cos[c + d*x]]/d, x] /; FreeQ[{c, d}, x]

Rubi steps

\begin {align*} \int \csc (c+d x) \left (a+b \sin ^2(c+d x)\right ) \, dx &=-\frac {b \cos (c+d x)}{d}+a \int \csc (c+d x) \, dx\\ &=-\frac {a \tanh ^{-1}(\cos (c+d x))}{d}-\frac {b \cos (c+d x)}{d}\\ \end {align*}

________________________________________________________________________________________

Mathematica [B] Leaf count is larger than twice the leaf count of optimal. \(63\) vs. \(2(26)=52\).
time = 0.02, size = 63, normalized size = 2.42 \begin {gather*} -\frac {b \cos (c) \cos (d x)}{d}-\frac {a \log \left (\cos \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {a \log \left (\sin \left (\frac {c}{2}+\frac {d x}{2}\right )\right )}{d}+\frac {b \sin (c) \sin (d x)}{d} \end {gather*}

Antiderivative was successfully verified.

[In]

Integrate[Csc[c + d*x]*(a + b*Sin[c + d*x]^2),x]

[Out]

-((b*Cos[c]*Cos[d*x])/d) - (a*Log[Cos[c/2 + (d*x)/2]])/d + (a*Log[Sin[c/2 + (d*x)/2]])/d + (b*Sin[c]*Sin[d*x])
/d

________________________________________________________________________________________

Maple [A]
time = 0.19, size = 33, normalized size = 1.27

method result size
derivativedivides \(\frac {a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-b \cos \left (d x +c \right )}{d}\) \(33\)
default \(\frac {a \ln \left (\csc \left (d x +c \right )-\cot \left (d x +c \right )\right )-b \cos \left (d x +c \right )}{d}\) \(33\)
risch \(-\frac {b \,{\mathrm e}^{i \left (d x +c \right )}}{2 d}-\frac {b \,{\mathrm e}^{-i \left (d x +c \right )}}{2 d}+\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}-1\right )}{d}-\frac {a \ln \left ({\mathrm e}^{i \left (d x +c \right )}+1\right )}{d}\) \(67\)
norman \(\frac {\frac {2 b \left (\tan ^{4}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}+\frac {2 b \left (\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}}{\left (1+\tan ^{2}\left (\frac {d x}{2}+\frac {c}{2}\right )\right )^{2}}+\frac {a \ln \left (\tan \left (\frac {d x}{2}+\frac {c}{2}\right )\right )}{d}\) \(68\)

Verification of antiderivative is not currently implemented for this CAS.

[In]

int(csc(d*x+c)*(a+sin(d*x+c)^2*b),x,method=_RETURNVERBOSE)

[Out]

1/d*(a*ln(csc(d*x+c)-cot(d*x+c))-b*cos(d*x+c))

________________________________________________________________________________________

Maxima [A]
time = 0.29, size = 38, normalized size = 1.46 \begin {gather*} -\frac {2 \, b \cos \left (d x + c\right ) + a \log \left (\cos \left (d x + c\right ) + 1\right ) - a \log \left (\cos \left (d x + c\right ) - 1\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="maxima")

[Out]

-1/2*(2*b*cos(d*x + c) + a*log(cos(d*x + c) + 1) - a*log(cos(d*x + c) - 1))/d

________________________________________________________________________________________

Fricas [A]
time = 0.43, size = 42, normalized size = 1.62 \begin {gather*} -\frac {2 \, b \cos \left (d x + c\right ) + a \log \left (\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right ) - a \log \left (-\frac {1}{2} \, \cos \left (d x + c\right ) + \frac {1}{2}\right )}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="fricas")

[Out]

-1/2*(2*b*cos(d*x + c) + a*log(1/2*cos(d*x + c) + 1/2) - a*log(-1/2*cos(d*x + c) + 1/2))/d

________________________________________________________________________________________

Sympy [F]
time = 0.00, size = 0, normalized size = 0.00 \begin {gather*} \int \left (a + b \sin ^{2}{\left (c + d x \right )}\right ) \csc {\left (c + d x \right )}\, dx \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*sin(d*x+c)**2),x)

[Out]

Integral((a + b*sin(c + d*x)**2)*csc(c + d*x), x)

________________________________________________________________________________________

Giac [B] Leaf count of result is larger than twice the leaf count of optimal. 58 vs. \(2 (26) = 52\).
time = 0.42, size = 58, normalized size = 2.23 \begin {gather*} \frac {a \log \left (\frac {{\left | -\cos \left (d x + c\right ) + 1 \right |}}{{\left | \cos \left (d x + c\right ) + 1 \right |}}\right ) + \frac {4 \, b}{\frac {\cos \left (d x + c\right ) - 1}{\cos \left (d x + c\right ) + 1} - 1}}{2 \, d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

integrate(csc(d*x+c)*(a+b*sin(d*x+c)^2),x, algorithm="giac")

[Out]

1/2*(a*log(abs(-cos(d*x + c) + 1)/abs(cos(d*x + c) + 1)) + 4*b/((cos(d*x + c) - 1)/(cos(d*x + c) + 1) - 1))/d

________________________________________________________________________________________

Mupad [B]
time = 13.37, size = 23, normalized size = 0.88 \begin {gather*} -\frac {b\,\cos \left (c+d\,x\right )+a\,\mathrm {atanh}\left (\cos \left (c+d\,x\right )\right )}{d} \end {gather*}

Verification of antiderivative is not currently implemented for this CAS.

[In]

int((a + b*sin(c + d*x)^2)/sin(c + d*x),x)

[Out]

-(b*cos(c + d*x) + a*atanh(cos(c + d*x)))/d

________________________________________________________________________________________